home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_cups.idb / usr / freeware / etc / cups / fix-spool-dir.z / fix-spool-dir
Text File  |  2002-04-08  |  1KB  |  58 lines

  1. #!/bin/sh
  2. #Tag 0x00000610
  3. #
  4. # Ensure that IRIX spooling system (lpsched) spool dirs are present,
  5. # as CUPS will write interface and status files in them.
  6. #
  7. # Author: Andrea Suatoni
  8. #
  9. # $Id: fix-spool-dir,v 1.1.1.1 2002/02/01 03:31:12 and Exp $
  10. #
  11.  
  12. IRIX_SPOOLDIR="/var/spool/lp"
  13. PRINT_USER="lp"
  14. PRINT_GROUP="sys"
  15.  
  16. #
  17. # Checks that we are the super-user
  18. #
  19. CheckPermission() {
  20.   cid=`/usr/bin/id | /usr/bin/nawk '{print substr($1,index($1,"("))}'`;
  21.   if [ "$cid" != "(root)" ]; then
  22.     echo "You must be logged in as root to use this program."
  23.     exit 1;
  24.   fi
  25. }
  26.  
  27. #
  28. # Check that the specified spooler dir exists, create it otherwise
  29. #
  30. CheckSpoolDir() {
  31.   if [ ! -d $1 ]; then
  32.     /sbin/mkdir $1
  33.     /sbin/chown $PRINT_USER\:$PRINT_GROUP $1
  34.   fi
  35. }
  36.  
  37. #########################################################################
  38. #
  39. # Main program
  40. #
  41.  
  42. #
  43. # Ensure that we are root
  44. #
  45. CheckPermission
  46.  
  47. #
  48. # Create the IRIX spooler directories, if not present
  49. #
  50. CheckSpoolDir $IRIX_SPOOLDIR
  51. CheckSpoolDir $IRIX_SPOOLDIR/activeicons
  52. CheckSpoolDir $IRIX_SPOOLDIR/class
  53. CheckSpoolDir $IRIX_SPOOLDIR/gui_interface
  54. CheckSpoolDir $IRIX_SPOOLDIR/gui_interface/ELF
  55. CheckSpoolDir $IRIX_SPOOLDIR/interface
  56. CheckSpoolDir $IRIX_SPOOLDIR/member
  57. CheckSpoolDir $IRIX_SPOOLDIR/pod
  58.